package com.bgq365.study.springboot2.boot02web.acutuator.endpoint;

import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.actuate.endpoint.annotation.WriteOperation;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.Map;

@Component
@Endpoint(id = "myservice")
public class MyServiceEndPoint {

    @ReadOperation
    public Map getDocketInfo() {
        return Collections.singletonMap("dockerInfo", "docket started ...");
    }

    @WriteOperation
    public void stopDocket(){
        System.out.println("stop docker");
    }
}
